package com.yike.order.param;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yike.common.api.Update;
import com.yike.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单表
 *
 * @author yike
 * @since 2024-07-18
 */
@Data
@Accessors(chain = true)
public class AddOrderParam implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "店铺ID", required = true)
    @NotNull(message = "店铺ID不能为空")
    private Long shopId;

    @ApiModelProperty(value = "支付金额", required = true)
    @NotNull(message = "支付金额不能为空")
    @Min(value = 0, message = "支付金额不能小于0")
    private BigDecimal amount;

    @ApiModelProperty(value = "设备编号", required = true)
    @NotNull(message = "设备编号不能为空")
    private String macNo;

    @ApiModelProperty(value = "商品信息", required = true)
    @NotEmpty(message = "商品信息不能为空")
    @Valid
    private List<AddOrderDetailParam> orderDetails;

}
